<include file="Public:header" />
<!--主体内容-->
<style>

</style>
<!--左边-->
<div class="centent_box">
    <include file="Public:left" />
    <!--右边-->
    <div class="centent_right_box">
        <div class="centent_right rightCon">
            <div class="Mtitle">
                <ul>
                    <li class="on"><span>客源跟进</span></li>
                </ul>
                <div class="rightWord"><a href="{:U('Cust/index')}">客源管理</a> &gt;&gt; 客源跟进</div>
            </div>
            <form id="info_form" action="{:U('Cust/follow')}" method="post" enctype="multipart/form-data">
            <div class="con_div">
                <ul class="formList width2 list_ul">
                    <li>添加跟进信息</li>
                    <li>
                        <textarea name="data[discuss]" rows="6" cols="80"></textarea>
                    </li>
                    <li></li>
                    <li>
                        <input type="hidden" name="data[source_id]" value="{$customs_id}" >
                        <input type="submit" value="提 交" class="btnStyle">
                    </li>
                </ul>
            </div>
            </form>
        </div>
    </div>
</div>
<js file="__S__/ueditor/ueditor.config.js" charset="utf-8" />
<js file="__S__/ueditor/ueditor.all.min.js" charset="utf-8" />
<js file="__S__/ueditor/lang/zh-cn/zh-cn.js" charset="utf-8" />
<script type="text/javascript">
    window.UEDITOR_HOME_URL='__STATIC__/ueditor/';
    window.onload=function(){
        window.UEDITOR_CONFIG.initialFrameWidth=880;
        window.UEDITOR_CONFIG.initialFrameHeight=500;
    }
    var ue = UE.getEditor('info', {
        toolbars: [[
            'fullscreen', 'source', '|',
            'bold', 'italic', 'underline', '|', 'fontfamily','fontsize', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', 'simpleupload','|', 'kityformula', 'preview'
        ]]
    });
</script>
<script src="__S__/js/jquery.validate.js"></script>
<script type="text/javascript">
    $(function(){
        $("#info_form").validate({
            rules: {
                title: {
                    required: true,
                    minlength: 2
                }
            },
            messages: {
                title: {
                    required: "请输入文章标题",
                    minlength: "文章标题一定要两个字以上"
                }
            }
        });
    });

    $(function(){

        $("input[class*=input_test]").each(function(){
                var oldVal=$(this).val();   //默认的提示性文本
                $(this).css({"color":"#888"})  //灰色
                        .focus(function(){
                            if($(this).val()!=oldVal){$(this).css({"color":"#000"})}else{$(this).val("").css({"color":"#888"})}
                        })
                        .blur(function(){
                            if($(this).val()==""){$(this).val(oldVal).css({"color":"#888"})}
                        })
                        .keydown(function(){$(this).css({"color":"#000"})})

        })
        //动态模糊搜索小区
        $('#estate_id').bind('input propertychange', function() {
            var oldValue = "";
            var newValue = $('#estate_id').val();
            if (oldValue != newValue){
                oldValue = newValue;
                var searchValue = $('#estate_id').val();
                $.ajax({
                    type: 'POST',
                    url:"user.php?m=Member&c=Cust&a=searchEstate",
                    data:{'searchValue':searchValue},
                    dataType: 'json',
                    success: function(jsonData) {
                        var json_data=eval("("+jsonData+")");
                        //alert(json_data.list[0].id);
                        var html = "<ul>";
                        for(var i=0;i<json_data.count;i++){
                            html += '<li>'+json_data.list[i].title+'</li>';
                        }
                        $("#show_message").show();
                        $("#show_message").html(html+"</>");
                        $("#show_message").fadeOut(10000);
                        return false;
                    },//end success
                    error:function(XMLHttpRequest, textStatus, errorThrown){
                        alert("数据加载失败");
                    }
                });
            }
        });

        $("#show_message").on('click','li',function(){
            $("#estate_id").val(($(this).text()));
            $("#show_message").hide();
        });

        //小区数据加载
        loadEstate();
    })

    function loadEstate(){
        $.ajax({
            type: 'POST',
            url:"user.php?m=Member&c=Cust&a=searchEstate",
            //data:{'searchValue':searchValue},
            dataType: 'json',
            success: function(jsonData) {
                var json_data=eval("("+jsonData+")");
                //alert(json_data.list[0].id);
                var html = "<option>请选择</option>";
                for(var i=0;i<json_data.count;i++){
                    html += '<option value="'+json_data.list[i].id+'">'+json_data.list[i].title+'</option>';
                }
                $("#estate_id").append(html);
                //$("#show_message").show();
                //$("#show_message").html(html+"</>");
                //$("#show_message").fadeOut(10000);
                return false;
            },//end success
            error:function(XMLHttpRequest, textStatus, errorThrown){
                alert("数据加载失败");
            }
        });
    }

</script>
<include file="Public:footer" />